package at.fhhagenberg.mcm09.elevator.controlTest;

import java.util.LinkedList;
import java.util.Queue;

import junit.framework.TestCase;
import at.fhhagenberg.mcm09.elevator.control.IAlgorithm;
import at.fhhagenberg.mcm09.elevator.control.ResortAlgorithm;
import at.fhhagenberg.mcm09.elevator.model.StopRequest;

public class ResortAlgorithmTest extends TestCase {
	public void testGetTargetFloor(){
		Queue<StopRequest> q = new LinkedList<StopRequest>();
		q.add(new StopRequest(1));
		q.add(new StopRequest(7));
		q.add(new StopRequest(9));
		q.add(new StopRequest(11));
		q.add(new StopRequest(8));
		//q.add(new StopRequest(9));
		q.add(new StopRequest(13));
		int curFloor = 10;
		
		IAlgorithm alg = new ResortAlgorithm();
		int cf = alg.getTargetFloor(q, curFloor);
		assertEquals(cf, 9);
	}

}
